/**
 * 发票与银行卡相关API
 */
import {
	http,
	Method
} from "@/utils/request.js";
import api from "@/config/api.js";


/**
 * 查询银行卡信息
 */
export function getBankCard() {
	return http.request({
		url: "/member/bank/getBank",
		method: Method.GET
	});
}

/**
 * 识别银行卡信息
 */
export function distinguishBankCard(params) {
	return http.request({
		url: "/member/bank/identify",
		method: Method.GET,
		params
	});
}

/**
 * 新增与编辑银行卡信息
 */
export function saveBankCard(data) {
	return http.request({
		url: `/member/bank/insertBank`,
		method: Method.POST,
		data,
	});
}

/**
 * 删除银行卡信息
 */
export function delBankCard(data) {
	return http.request({
		url: `/member/bank/delBank`,
		method: Method.GET,
		data,
	});
}

/**
 * 发送验证码
 */
export function sendVerCode(params) {
	return http.request({
		url: `${api.common}/sms/smsSend`,
		method: Method.GET,
		params
	});
}

/**
 * 查询发票信息
 */
export function getInvoice() {
	return http.request({
		url: "/member/receipt/page",
		method: Method.GET
	});
}

/**
 * 新增发票信息
 */
export function saveInvoice(data) {
	return http.request({
		url: `/member/receipt`,
		method: Method.POST,
		data,
	});
}

/**
 * 编辑发票信息
 */
export function updateInvoice(data) {
	return http.request({
		url: `/member/receipt`,
		method: Method.PUT,
		data,
	});
}

/**
 * 删除发票信息
 */
export function delInvoice(params) {
	return http.request({
		url: `/member/receipt`,
		method: Method.GET,
		params,
	});
}
/**
 * 开发票
 */
export function saveOrderInvoice(params) {
	return http.request({
		url: `/trade/receipt/save`,
		method: Method.GET,
		params,
	});
}